/**
 * 约定：这个文件导出的每一个Request类实例，对应一个请求地址前缀
 */

// service统一出口
import Request from './request/index.js'
import { HYBaseOpt } from './config.js'

// 导出 HYRequest 请求工具
export const HYRequest = new Request({
  baseURL: HYBaseOpt.BASE_URL,
  timeout: HYBaseOpt?.TIME_OUT ?? 60000,
  interceptors: {
    requestInterceptor: (config) => {
      return config
    },
    requestInterceptorCatch: (error) => {
      return error
    },
    responseInterceptor: (res) => {
      return res
    },
    responseInterceptorCatch: (error) => {
      return error
    }
  }
})
